<template>
    <div>
      <el-container style="height: 900px; border: 1px solid #eee "> 
        <el-aside width="200px" style="background-color: rgb(238, 241, 246)">   
          <el-menu :default-openeds="['1', '3']">
            <el-submenu index="1">
              <template slot="title"><i class="el-icon-message"></i>导航一</template>
              <el-menu-item-group>
                <template slot="title">分组一</template>
                <el-menu-item index="1-1">选项1</el-menu-item>
                <el-menu-item index="1-2">选项2</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="2">
              <template slot="title"><i class="el-icon-menu"></i>导航二</template>
              <el-menu-item-group>
                <template slot="title">分组一</template>
                <el-menu-item index="2-1">选项1</el-menu-item>
                <el-menu-item index="2-2">选项2</el-menu-item>
              </el-menu-item-group>
              <el-menu-item-group title="分组2">
                <el-menu-item index="2-3">选项3</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-container>
          <el-header style="text-align: left; font-size: 20px; border: #eee; font-weight: bold;">
            学生信息管理系统
          </el-header>
          <el-main>
            <!-- 查询 -->
            <el-form :inline="true" :model="formInline" class="demo-form-inline">
              <el-form-item label="学生ID">
                <el-input v-model="formInline.id"></el-input>
              </el-form-item>
              <el-form-item label="姓名">
                <el-input v-model="formInline.name"></el-input>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="onSubmit">查询</el-button>
              </el-form-item>
            </el-form>
            <!-- 表格数据 -->
              <el-table :data="tableData">
                <el-table-column prop="id" label="序号" width="120">
                </el-table-column>
                <el-table-column prop="date" label="日期" width="140">
                </el-table-column>
                <el-table-column prop="name" label="姓名" width="120">
                </el-table-column>
                <el-table-column prop="gender" label="性别" width="120">
                </el-table-column>
                <el-table-column prop="age" label="年龄" width="120">
                </el-table-column>
                <el-table-column prop="sc" label="学院">
                </el-table-column>
                <el-table-column prop="do" label="操作">
                  <el-button type="primary" icon="el-icon-edit" @click="onEdit"></el-button>
                  <el-button type="danger" icon="el-icon-delete" @click="onDelete"></el-button>
                </el-table-column>
              </el-table>
          </el-main>
        </el-container>
      </el-container>
    </div>
    
</template>

<script>
// import axois from 'axios';
export default {
    data(){
      
    return {
      tableData: Array(20).fill().map((_, index) => ({
        date: `2024-06-${index + 1 < 10 ? '0' : ''}${index + 1}`,
        id: index + 1,
        name: '李明',
        gender: "男",
        age: 19,
        sc: '计算机与通信工程学院'
      })),
        formInline: {
          id: '',
          name: ''
        }
    }
  },
  methods:{
    onSubmit(){
      console.log("submit")
    },
    onEdit(){
      console.log("编辑信息")
    },
    onDelete(){
      var msg = confirm("你确定要删除吗？")
      if(msg == true){
        alert('成功删除')
      }
    }
  }
}
</script>

<style>
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }
  
  .el-aside {
    color: #333;
  }
</style>